Support pure JVM JAR compilation and packaging for desktop JVM#20761
Support pure JVM JAR compilation and packaging for desktop JVM#20761RanjithRagavan wants to merge 5 commits into
Conversation
…(Linux/macOS/Windows)
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20761
Note: Links to docs will display an error until the docs builds have been completed. ❌ 28 New FailuresAs of commit 36cd9f2 with merge base af62dce ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: none" |
|
Hi @RanjithRagavan, thank you for the PR. Could you address the CI failures? |
…classpath to resolve Kotlin duplicate loading and classloader issues
|
Thanks @RanjithRagavan for the PR. The idea is strong and imo worth pursuing — a pure-JVM ExecuTorch artifact for desktop (Linux/macOS/Windows) is good in terms of direction This requires a bit of a redesign before it's mergeable, so let me lay out my thoughts rather than line-by-line comments.
extension/
Happy to help scope the shared-module split and the native-packaging approach. IMO this is a valuable addition and worth getting the foundation right. 🙏 |
psiddh
left a comment
There was a problem hiding this comment.
Please take a look at the feedback
|
valuable feedbacks.. Will work on it. |
- Extract platform-neutral API into shared 'extension/java/' module
- Replace reflection-based logging with ServiceLoader Logger SPI
- Create thin sibling platform modules ('extension/android/' and 'extension/jvm/')
- Implement per-OS NativeLibraryLoader and NativeLoader JvmDelegate on desktop JVM
- Relocate unit tests to shared module for fast JVM test execution
b9b0432 to
50fcff9
Compare
1. Extracted Shared Platform-Neutral Java APIExtracted the platform-neutral Java API into a shared module and converted the Android and JVM modules into thin sibling shells:
2. Replace Reflection-Based Logging with a Logger InterfaceWe introduced the
3. Solve Native Library Delivery on JVM Desktop
4. Tests and Verification
|
|
This is a good redesign. I want to be clear about the bar this change has to clear, though. ExecuTorch Android is a foundational, widely-deployed dependency in production, so the Android path must not regress. Before we can consider next steps this will need thorough vetting and careful consideration, internal integration validation, a release-shrunk consumer build, and an AAR before/after diff proving the shipping artifact is unchanged. Please bear with a slower, more careful review than usual; it's a reflection of the surface area and potential blast radius, not the quality of the work. Thanks for the collaboration! I'll summarize the next steps. |
This PR adds support for compiling and packaging the ExecuTorch Java/Kotlin APIs as a standard JVM JAR package targeting desktop platforms (Linux, macOS, Windows). It resolves #16422 by decoupling the codebase from Android-specific APIs (using reflection to delegate android logging) and adding a new
:executorch_jvmGradle project. In addition, the JNI CMake configuration has been expanded to support building on desktop hosts.cc @kirklandsign @cbilgin